import React, {Component} from 'react'
import {
    View,
    StyleSheet,
    Image,
    Text,
    TouchableOpacity
} from 'react-native'
import navigationhelper from 'src/components/navigationhelper'
import Layer from "src/components/Layer"
import {inject, observer} from "mobx-react/native"
import { Flex } from '@ant-design/react-native';

@inject('userAuth')
@observer
export default class MyMoney extends Component<{}> {
    render() {
        let {balance, today_income, income} = this.props.userAuth.currentUser
        return (
            <Flex style={[styles.container, this.props.style]} onPress={()=>{
                navigationhelper.navigate('ReceiveMoneyTeam', {dict:this.props.userAuth.currentUser})
            }}>
                <View style={styles.userInfo}>
                    <View style={styles.numberModel}>
                        <Text style={styles.titleText}>账户余额</Text>
                        <Text style={styles.numberText}>{balance}</Text>
                    </View>
                    <View style={{flex: 1}}/>
                    <View style={styles.numberModel}>
                        <Text style={styles.titleText}>今日收益</Text>
                        <Text style={styles.numberText}>{today_income?today_income:'0'}</Text>
                    </View>
                    <View style={{flex:1}}/>
                </View>
                    <View style={styles.vip}>
                        <Image source={require('src/assets/mine/arrowRight.png')}/>
                    </View>
            </Flex>
        )
    }
}
const styles = StyleSheet.create({
    container: {
        display: 'flex',
        flexDirection: 'row',
        alignItems: 'center',
        height: 32,
        backgroundColor: 'transparent'
    },
    userInfo: {
        flex: 1,
        flexDirection: 'row',
        paddingLeft: 16
    },
    vip: {
        paddingRight: 11,
        width: 35,
        height: 24,
        backgroundColor: 'transparent'
    },
    titleText: {
        fontSize: 10,
        lineHeight: 15,
        fontFamily: 'PingFang SC',
        color: '#FFFFFF'
    },
    numberText: {
        fontSize: 16,
        lineHeight: 19,
        marginTop: 1,
        fontFamily: 'PingFang SC',
        color: '#FFFFFF'
    },
    numberModel: {
        display: 'flex',
        alignItems: 'center',
        justifyContent: 'center'
    }

})